package cn.tedu.boot011.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController {
    @RequestMapping("/bmi")
    @ResponseBody
    public String bmi(double height, double weight) {
        System.out.println("height = " + height + ", weight = " + weight);
        double bmi = weight / (height * height);
        if (bmi < 17.5) {
            return "多吃点肉吧，瞅你瘦的跟块排骨一样!";
        }
        if (bmi<24){
            return "你身体真是杠杠滴!";
        }
        if (bmi<27){
            return "少吃点吧，有点胖了!";
        }
        return "别再吃了，瞅你胖的，该减肥了!";
    }
}
